home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c
- Subject: Re: fflush and Visual C++
- Date: Mon, 18 Mar 1996 00:23:01 GMT
- Organization: Netcom
- Message-ID: <314cab43.174488401@nntp.ix.netcom.com>
- References: <4idhv5$dnv@news.mhv.net> <314b173b.71056173@nntp.ix.netcom.com> <4ifuuf$fha@solutions.solon.com> <314c3a5f.145588955@nntp.ix.netcom.com> <4ii027$n7c@solutions.solon.com>
- NNTP-Posting-Host: ix-dc12-26.ix.netcom.com
- X-NETCOM-Date: Sun Mar 17 6:21:45 PM CST 1996
- X-Newsreader: Forte Agent .99d/32.182
-
- seebs@solutions.solon.com (Peter Seebach) wrote:
-
- > In article <314c3a5f.145588955@nntp.ix.netcom.com>,
- > Mike Rubenstein <miker3@ix.netcom.com> wrote:
- > >What's incorrect? Are you claiming that Visual C does not implement
- > >fflush() correctly?
- >
- > No. I'm claiming that it's incorrect to say that fflush(stdin) does not
- > flush input buffers. It's just also incorrect to say that it does.
-
- Strange view. The question concerned Visual C++ and, as far as I
- know, fflush(stdin) never flushes input buffers in that compiler.
- Looking at the source code for fflush() I don't see how it could. I
- will stand on my original statement than in Visual C++ fflush(stdin)
- does not flush input buffers.
-
- >
- > >And claiming that someone is wrong for saying that a function doesn't
- > >do something when the language definition does not define it as doing
- > >it is rather pedantic. Sure, it is true (as I point out) that
- > >fflush(stdin) can do anything, but I'd not suggest using it when you
- > >want to format your hard disk -- there are quite a few implementations
- > >that will not do that. :-)
- >
- > Yes, it's quite pedantic. But it's a significant distinction; an
- > implementation is allowed to do anything, including what you expect,
- > when you do something wrong.
-
- A distinction that I pointed out in my original post:
-
- fflush() with stdin as an argument results in undefined
- behavior.
-
- Or don't you understand what "undefined behavior" means? I'm sorry I
- assumed that people would know what a term defined in the standard and
- often discussed here means.
-
-
- Michael M Rubenstein
-